package com.heima.test01;


import java.util.ArrayList;
import java.util.Random;

public class Demo03 {
    public static void main(String[] args) {
        Random ra = new Random();
        //新建集合,存放大于等于30的数
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            //随机生成一个1~100的数字
            int num = ra.nextInt(100) + 1;
            System.out.print(num+" ");
            //判断是否大于30,大于等于存放
            if (num >= 30){
                list.add(num);
            }
        }
        //换行
        System.out.println();
        System.out.println(list);
    }

}
